import json
from tqdm import tqdm

"""
生成疾病、症状集合的 text
"""

def readjson(file_path):
  """"""
  # make_path_legal(file_path)
  with open(file_path, "r", encoding="utf-8") as f:
    return json.load(f)

def writejson(data, file_path):
  """"""
  # make_path_legal(file_path)
  with open(file_path, "w", encoding="utf-8") as f:
    f.write(json.dumps(data, ensure_ascii=False, indent=2))

if __name__ == '__main__':
    ori_data = './jibing_zhengzhuang.json'
    save_data = './jibing_zhengzhuang_set_eval.json'
    result = []
    for item in tqdm(readjson(ori_data)):
        result.append(' '.join(item))
    writejson(result, save_data)


